<?php

namespace app\common\cachemodel\privatearea;

use app\common\model\BaseCache;

class PrivateAreaMallOrdersRefundRecord extends BaseCache
{
    protected $table = 'wechat_backup_07_18_14_43_00.private_area_mall_orders_refund_record';

    public function saveData($data)
    {
        try
        {
            $id = $this->insertGetId($data);
        }
        catch (\Exception $e)
        {
            \think\Log::write(__CLASS__ . ' => ' . __FUNCTION__ . '()异常：' . $e->getMessage() . '失败信息：' . $e->getFile() . ':' . $e->getLine(), 'error', true);
            $id = 0;
        }
        return (int)$id;
    }

    public function updateData($id, $data)
    {
        try
        {
            $this->where('id', $id)->update($data);
        }
        catch (\Exception $e)
        {
            \think\Log::write(__CLASS__ . ' => ' . __FUNCTION__ . '()异常：' . $e->getMessage() . '失败信息：' . $e->getFile() . ':' . $e->getLine(), 'error', true);
        }
    }
}